home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 5455 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  737 b 

  1. Path: isum2.iastate.edu!cakamman
  2. From: cakamman@iastate.edu (Chris A Kamman)
  3. Newsgroups: comp.lang.c
  4. Subject: Reading files - DOS & UNIX
  5. Date: 8 Feb 96 15:29:46 GMT
  6. Organization: Iowa State University, Ames, Iowa
  7. Message-ID: <cakamman.823793386@isum2.iastate.edu>
  8. NNTP-Posting-Host: isum2.iastate.edu
  9.  
  10. Hi,
  11.  
  12.     I would like to have the same program read text files on SUN and
  13. PC.
  14.  
  15.     What I ended up doing was - use fopen with rb mode. Then remove
  16. the linefeed and carraige return characters if they exist. This solu
  17. works.
  18.  
  19. But I don't know if I can use fgets on a stream opened in binary mode
  20. (I am assuming I am right because the char is binary is same as char in
  21. text?).
  22.  
  23. Thanks for any info/tips.
  24. -- 
  25. Chris A Kamman
  26. cakamman@iastate.edu
  27.